﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using Microsoft.Http;
using TMShopClient.Interface;


namespace HtmlViewer {
    [Export("text/html",typeof(IResponseController))]
    public class HtmlController : IResponseController  {

        [Import]
        private IShell _Shell = null;

        private HtmlView _HtmlView;

        public void Handle(HttpResponseMessage response) {
            _HtmlView = new HtmlView();
            _HtmlView.Document = response.Content.ReadAsString();
            _Shell.ShowView(_HtmlView);
        }

        public void Deactivate() {
            _HtmlView.Dispose();
        }

        public void ReturnFromChild(object returnValue) {
            throw new NotImplementedException();
        }
    }
}
